package bma.common.thrift.xdom;

public class TDynamicField {

	private int key;
	private String name;
	private TDynamicType type;
	private boolean optional;

	public int getKey() {
		return key;
	}

	public void setKey(int key) {
		this.key = key;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public TDynamicType getType() {
		return type;
	}

	public void setType(TDynamicType type) {
		this.type = type;
	}

	public byte getTypeValue() {
		if (type != null)
			return type.getType();
		return 0;
	}

	public String getTypeName() {
		if (type != null)
			return type.getName();
		return null;
	}

	public TDynamicType getInnerType() {
		if (type != null)
			return type.getInnerType();
		return null;
	}

	public boolean isOptional() {
		return optional;
	}

	public void setOptional(boolean optional) {
		this.optional = optional;
	}

}
